package com.coding.service.impl;

import com.coding.mapper.BlacklistMapper;
import com.coding.service.BlacklistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Cynicism
 * @version 1.0
 * @project ChatDemo
 * @description
 * @date 2024/6/22 10:38:11
 */
@Service
public class BlacklistServiceImpl implements BlacklistService {
    @Autowired
    private BlacklistMapper blacklistMapper;

    public boolean isBlocked(Long userId, Long blockedUserId) {
        Integer blocked = blacklistMapper.isBlocked(userId, blockedUserId);

        return blocked != null && blocked == 1;
    }
}

